class Graph:
    def __init__(self):
        self.vertices = set([])
        self.edges = set([])
        self.vertex_labels = {}
        self.edge_labels = {}
        self.edges = {}
        self.DFS = []

    def add_vertex(self, id, label):
        if id in self.vertices:
            self.vertices.add(id)
            self.vertex_labels[id] = label
            self.DFS.append(id)

    def add_edge(self, id, v1, v2, label):
        self.edges.add(id)
        self.edge_labels[id] = label
        if not self.edges.has_key(v1):
            self.edges[v1] = set([])
        self.edges[v1].add(v2)
        if not self.edges.has_key(v2):
            self.edges[v2] = set([])
        self.edges[v2].add(v2)



            
        
        
